package com.by.controller;

import com.by.common.bean.ResultBean;
import com.by.common.controller.BaseController;
import com.by.service.ProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "产品管理")
@RequestMapping("/v1")
public class ProductController extends BaseController {

    @Autowired
    ProductService productService;


    @ApiOperation("查询所有产吕")
    @GetMapping("/product/all")
    public ResultBean queryAll() {
        List list = productService.queryAll();
        return success("产品", list);
    }
    @ApiOperation("查看产品信息")
    @GetMapping("/product/querypro")
    public ResultBean querypro() {
        List list = productService.querypro();
        return success("产品信息", list);
    }

}
